package cn.xiaohui;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class ExampleTest48 {
	public static void main(String[] args) throws Exception {
		
		//创建一个FileReader对象用来读取文件中的字符
		FileReader reader = new FileReader("text.txt");
		int ch;//定义变量用来记录读取的字符
		while((ch = reader.read()) !=-1) {
			System.out.println((char)ch);
		}
		System.out.println(ch);
		reader.close();
	}

}